/*********************************************
This file is part of HIM.

HIM is a module of BCI++ framowork for the implementation of Brain Computer Interface systems.
HIM is intended for use with BCI++ only.

BCI++ is a project of the Sensibilab of Politecnico Di Milano

HIM is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as 
published by the Free Software Foundation, either version 3 of 
the License, or (at your option) any later version.

HIM is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
GNU Lesser General Public License for more details.

You should have received a copy of the GNU General Public License
and the GNU Lesser General Public License along with HIM.  
If not, see <http://www.gnu.org/licenses/>.
*************************************************************/

#pragma once

#include "BaseAlgoConfig.h"
#include <wx/wx.h>

const int	MAX_CHANNELS	=	256;
const int	MAX_FEEDS		=	8;
/*! /struct DataStruct
	This struct is used to store the acquired signal
*/
typedef struct HimDataStruct
{
//! This vector contain one sample for each signal
	float	Signal[MAX_CHANNELS];
//! Numeber of valid elements in /a Signal
	int		DataLen;
//! AUXiliary channel
	float	AUX;
//! For future use: will contain artifact identification markers
	int		Artifacts;
}HimDataStruct;//1026
/*! /struct DataStruct
	This struct is used to store information about events
*/
typedef struct EventStruct
{
//! Graphical triggers sent by AEnima usig the TCP/IP connection
	int		AEnimaTrigg;
//! Manual triggers set using the buttons in the main panel
	int		HIMTrigg;
//! Hardware triggers coming from the data acquisition device (if supported)
	int		HWTrigger;
//! Communication statistics, for future use: will contain information about communication errors
	int		CommunicationStats;
}EventStruct;
/*! /struct AlgoStruct
	This struct is used to store information about the online sesult of the algorithms
*/
typedef struct AlgoStruct
{
//! Vector containing the feedback output
	float	Feedback[MAX_FEEDS];
//! Number of valid values int 
	int		FeedLen;
	float	Classification;
}AlgoStruct;//40 bytes

typedef struct SampleStruct
{
	HimDataStruct	Data;
	AlgoStruct		Algo;
	EventStruct		Events;
}SampleStruct;//TOTALE 1092 bytes

/*! /struct Alostats
	This struct is used to store some useful information about Algorithm execution
*/
typedef struct Algostats
{
	int		CountMain,CountSec;
	double	TimeMain,TimeSec;
	double	FreqMain,FreqSec;
}Algostats;
/*! /struct TimerParams
	This struct is for internal use and is called by the profiling routines
*/
typedef struct TimerParams
{
	int		Count;
	wxLongLong	Begin;
	double	Accumulator;
}TimerParams;

typedef struct AcqInfo
{
	char				BatteryLevel;
	unsigned long int	ReceivedSamples;
	int					Errors,LostPackets;
	unsigned long int	BeginTime,ElapsedTime;
	float				EstimatedFrequency;
}AcqInfo;

